<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateWxusersTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('wxusers', function (Blueprint $table) {
            $table->increments('id');
            $table->string('open_id')->nullable()->comment('小程序open_id');
            $table->string('user_id')->nullable()->comment('微信open_id');
            $table->string('nick_name')->nullable()->comment('昵称');;
            $table->string('head_image_url')->default('no.jpg')->comment('头像');;
            $table->integer('sex')->nullable()->comment('性别');
            $table->string('country')->nullable()->comment('国家');
            $table->string('province')->nullable()->comment('省');
            $table->string('city')->nullable()->comment('城市');
            $table->integer('subscribe')->nullable()->comment('是否关注公众号');
            $table->string('subscribe_time')->nullable()->comment('关注时间');
            $table->integer('setp')->nullable()->comment('级别');
            $table->string('token')->nullable()->comment('用户token');
            $table->timestamps();
            $table->softDeletes();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('wxusers');
    }
}
